/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author XYMTOP
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface TbOrderStatus extends BasicModel<TbOrderStatus> {
  statusId?: string; // 状态id
  orderId?: string; // 订单id
  orderStatus?: number; // 当前状态
  executor?: string; // 当前状态执行人ID号
  sendingTime?: string; // 派单时间
  acceptTime?: string; // 执行人接单时间
  expectFinishTime?: string; // 期望完成时间
  finishTime?: string; // 实际完成时间
  finishStatus?: number; // 当前状态执行情况（0未接单，1执行中，2已完成，3已转单）
  comment?: string; // 备注
  deleted?: number; // 逻辑删除（0正常，1删除）
}

export const tbOrderStatusList = (params?: TbOrderStatus | any) =>
  defHttp.get<TbOrderStatus>({ url: adminPath + '/tb/tbOrderStatus/list', params });

export const tbOrderStatusListData = (params?: TbOrderStatus | any) =>
  defHttp.post<Page<TbOrderStatus>>({ url: adminPath + '/orderStatus/listData', params });

export const tbOrderStatusForm = (params?: TbOrderStatus | any) =>
  defHttp.get<TbOrderStatus>({ url: adminPath + '/tb/tbOrderStatus/form', params });

export const tbOrderStatusSave = (params?: any, data?: TbOrderStatus | any) =>
  defHttp.postJson<TbOrderStatus>({ url: adminPath + '/orderStatus/save', params, data });

export const tbOrderStatusDelete = (params?: TbOrderStatus | any) =>
  defHttp.get<TbOrderStatus>({ url: adminPath + '/orderStatus/delete', params });
